// run: $exec < input
#include <iostream>
#include <string>

int const maxn = 100007;
int const mo = 1000000007;
int dp[maxn];
int n, x;

std::string s, t;

int main()
{
	std::cin >> s >> t;
	int ls = s.size(), lt = t.size(), sum = 0;
	for (int i = lt, now = 0; i <= ls; i++) {
		sum = (sum + dp[i - lt] + 1) % mo;
		if (!s.compare(i - lt, lt, t)) now = sum;
		dp[i] = (dp[i - 1] + now) % mo;
	}
	std::cout << dp[ls] << '\n';
}

